<cfcomponent extends="queries">
        
    
    <!--- Get NonSCFTypes --->
    <cffunction name="funcGetNonSCFTypes" returntype="query">
    	<cfargument default="" name="ID" type="string" />
        
        <cfquery name="qryGetNonSCFTypes" datasource="RosettaStone">
        	<!--- scf_GetNonSCFTypes - old scott stored procedure--->
            SELECT * 
            FROM NonSCFTypes
            WHERE ID <> 1
        </cfquery>
        
    	<cfreturn qryGetNonSCFTypes />
    </cffunction>
    <!--- Get NonSCFTypes --->
    
    
    
    
    <!--- Insert Employee --->
    <cffunction name="funcStep1InsertEmployee" returntype="boolean">
    	<cfargument default="" name="FORM" required="yes" />
        
        <cfif ARGUMENTS.FORM.EstStartDate EQ "">
        	<cfset LOCAL.Start = dateformat(now(),'mm/dd/yyyy')>
        <cfelse>
    		<cfset LOCAL.Start = dateformat(ARGUMENTS.FORM.EstStartDate,'mm/dd/yyyy')>
        </cfif>
    	<cfset LOCAL.DateOfExpire = dateformat(dateadd('m',1,LOCAL.Start),'mm/dd/yyyy')>
        
        <cfquery name="qryStep1InsertEmployee" datasource="#Session.DataSource#">                                
                INSERT INTO Employee 
                	(                   
                    First,
                    PreferredName, 
                    Middle,
                    Last,
                    SupervisorID,
                    DeptID,
                    MirrorAccountID,
                    DeskPhone,
                    BadgeAccessLevelID,
                    ContainerID,
                    NonSCFTypeID,
                    CompanyName,
                    ExpDate,
                    BadgePos,
                    SSN,
                    EstStartDate,
                    NonSCFNetworkAccount,
                    NonSCFBadge                  
                    )
                VALUES 
                	(   
                    <cfqueryparam cfsqltype='cf_sql_varchar' value='#trim(ARGUMENTS.FORM.First)#' />, 
                    <cfqueryparam cfsqltype='cf_sql_varchar' value='#trim(ARGUMENTS.FORM.PreferredName)#' />, 
                    <cfqueryparam cfsqltype='cf_sql_varchar' value='#trim(ARGUMENTS.FORM.Middle)#'/>, 
                    <cfqueryparam cfsqltype='cf_sql_varchar' value='#trim(ARGUMENTS.FORM.Last)#' />,
                    <cfqueryparam cfsqltype='cf_sql_integer' value='#Session.arrEmpInfo.MasterID#' />,
                    <cfqueryparam cfsqltype='cf_sql_integer' value='#ARGUMENTS.FORM.DeptID#' />,
                    <cfqueryparam cfsqltype='cf_sql_integer' value='#ARGUMENTS.FORM.MirrorAccountID#' />,
                    <cfqueryparam cfsqltype='cf_sql_varchar' value='#trim(ARGUMENTS.FORM.DeskPhone)#' />,
                    <cfqueryparam cfsqltype='cf_sql_varchar' value='#ARGUMENTS.FORM.BadgeAccessLevelID#' />,
                    <cfqueryparam cfsqltype='cf_sql_integer' value='#ARGUMENTS.FORM.ContainerID#' />,
                    <cfqueryparam cfsqltype='cf_sql_integer' value='#ARGUMENTS.FORM.NonSCFTypeID#' />,
                    <cfqueryparam cfsqltype='cf_sql_varchar' value='#trim(ARGUMENTS.FORM.CompanyName)#' />,
                    <cfqueryparam cfsqltype='cf_sql_date' value='#LOCAL.DateOfExpire#' />,
                    <cfqueryparam cfsqltype='cf_sql_varchar' value='#trim(ARGUMENTS.FORM.BadgePos)#' />,
                    <cfqueryparam cfsqltype='cf_sql_varchar' value='#trim(ARGUMENTS.FORM.SSN)#' />,
                    <cfqueryparam cfsqltype='cf_sql_date' value='#ARGUMENTS.FORM.EstStartDate#' />,
                    <cfif isDefined('ARGUMENTS.FORM.NonSCFNetworkAccount') >
                    	<cfqueryparam cfsqltype='cf_sql_bit' value='1' />,
                    <cfelse>
                    	<cfqueryparam cfsqltype='cf_sql_bit' value='0' />,
                    </cfif>
                    <cfif isDefined('ARGUMENTS.FORM.NonSCFBadge') >
                    	<cfqueryparam cfsqltype='cf_sql_bit' value='1' />
                    <cfelse>
                    	<cfqueryparam cfsqltype='cf_sql_bit' value='0' />
                    </cfif>
                    )
                                   
                SELECT @@Identity AS NewID            
            </cfquery>
            
            <!--- EPLS CHECK --->
        	<cfset Cleared = SUPER.EPLSCheck('#trim(ARGUMENTS.FORM.First)#', 
				'#trim(ARGUMENTS.FORM.PreferredName)#', 
				'#trim(ARGUMENTS.FORM.SSN)#', 
				#qryStep1InsertEmployee.NewID#)> 
			
            <cfset SUPER.funcInsertAction(qryStep1InsertEmployee.NewID, 1, Session.intUserRosettaID, replace(trim(ARGUMENTS.FORM.Comments),"'","''","all")) />
            
            <cfif Cleared>
            	<cfset SUPER.funcInsertAction(qryStep1InsertEmployee.NewID, 3) />
            <cfelse>
            	<cfset SUPER.funcInsertAction(qryStep1InsertEmployee.NewID, 16) />
            </cfif>        
            
    	<cfreturn True />
    </cffunction>
    <!--- Insert Employee --->
    
    
    
    
       
</cfcomponent>